ES6 新功能


Posted by Rich on 2021-04-25

let name = rich
console.log(`hello ${name}`)
//output: hello rich
var  obj = {
    a:1,
    b:2
}
var obj2 = {
    ...obj,   ///destructuring
    c: 3
}
var {a, ...rest} = obj2 //rest parameters
console.log(rest)
//output:{b: 2, c: 3}









Related Posts

[Linux] Windows安裝Wsl2 + Ubuntu22.04 + Docker +Oracle

[Linux] Windows安裝Wsl2 + Ubuntu22.04 + Docker +Oracle

【JS學習筆記】認識 for...in 與他的兄弟 for...of

【JS學習筆記】認識 for...in 與他的兄弟 for...of

15. Command

15. Command


Comments